<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div style="width:50%;height: 200px;float: left">
    <form id="form1" action="#"> 
        账&nbsp;&nbsp;&nbsp;号：<input type="text" size="15"/><br/>
        用户名：<input type="text" size="15"/><br/>
        密&nbsp;&nbsp;&nbsp;码：<input type="password" size="15"/><br/>
        爱好：<input type="radio" name="a"/>音乐<input type="radio" name="a"/>舞蹈<input type="radio" name="a"/>足球<input type="radio" name="a"/>游戏<br/>
        资料上传：<input type="file"/><br/>
        热销产品：<input type="checkbox" />美白滋养霜<input type="checkbox" name="c"/>美白润体乳<input type="checkbox" checked />美白面膜<input type="checkbox"/>美白柔肤水<br/>
        <input type="submit" value="提交"  onclick="get()"/><input type="reset" value="重置"/><br/><br/>
    </form>
</div>
<div style="width:35%;display: inline-block;height: 200px;;float: left">
    <h3>统计结果如下：</h3>
    <hr>
    input:<label class="input"></label><br>
    text:<label class="text"></label><br>
    password:<label class="password"></label><br>
    checkbox:<label class="checkbox"></label><br>
    radio:<label class="radio"></label><br>
    file:<label class="file"></label><br>
    submit:<label class="submit"></label><br>
    reset:<label class="reset"></label><br>
</div>
<script src="jquery.js"></script>
<script type="text/javascript">
    function get(){
            var inputs = $("input").length;
            var texts = $(":text").length;
            var passwords = $(":password").length;
            var checkboxs = $(":checkbox").length;
            var radios = $(":radio").length;
            var files = $(":file").length;
            var submits = $(":submit").length;
            var resets = $(":reset").length;
            $(".input").text(inputs);
            $(".text").text(texts);
            $(".password").text(passwords);
            $(".checkbox").text(checkboxs);
            $(".radio").text(radios);
            $(".file").text(files);
            $(".submit").text(submits);
            $(".reset").text(resets);
    };
</script>
</body>
</html>